package com.seckill.order.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.seckill.order.pojo.Order;

import java.io.IOException;
import java.util.Map;

/**
 * @author Administrator
 */
public interface OrderService extends IService<Order> {

    /***
     * 热点商品下单
     */
    void hotAdd(Map<String, String> orderMap) throws IOException;

    /***
     * 添加订单
     */
    int add(Order order);

    /***
     * Order多条件分页查询
     * @param order
     * @param page
     * @param size
     * @return
     */
    Page<Order> findPage(Order order, int page, int size);

    /**
     * 查询订单详情
     * @param id
     * @return
     */
    Order findById(String id);

    /**
     * 订单支付
     * @param id
     */
    void pay(String id);

    /**
     * 保存订单, 下单操作
     * @param dataMap
     * @throws InterruptedException
     */
    void saveOrder(Map<String, Object> dataMap) throws InterruptedException;

}
